<?php

/* Sends an email from sender to receiver with subject and body, given in the parameter
 * Author: Panos Sakkos
 */

function BL_SendEmail($senderId, $receiver, $subject, $body)
{
	$sender = DB_getUserData($senderId);

	if($sender < 0)
		return BL_SEND_EMAIL;

	DB_user_getemail($receiver, $receiverEmail);

	$headers = "From: ". $sender->GetEmail();

	return mail($receiverEmail, $subject, $body, $headers) ? BL_OK : BL_SEND_EMAIL;
}

?>